\(\int \sec ^4(e+f x) (a+b \sin ^2(e+f x)) \, dx\) [290]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 30 \[ \int \sec ^4(e+f x) \left (a+b \sin ^2(e+f x)\right ) \, dx=\frac {a \tan (e+f x)}{f}+\frac {(a+b) \tan ^3(e+f x)}{3 f} \]

[Out]

a*tan(f*x+e)/f+1/3*(a+b)*tan(f*x+e)^3/f

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.048, Rules used = {3270} \[ \int \sec ^4(e+f x) \left (a+b \sin ^2(e+f x)\right ) \, dx=\frac {(a+b) \tan ^3(e+f x)}{3 f}+\frac {a \tan (e+f x)}{f} \]

[In]

Int[Sec[e + f*x]^4*(a + b*Sin[e + f*x]^2),x]

[Out]

(a*Tan[e + f*x])/f + ((a + b)*Tan[e + f*x]^3)/(3*f)

Rule 3270

Int[cos[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = FreeF
actors[Tan[e + f*x], x]}, Dist[ff/f, Subst[Int[(a + (a + b)*ff^2*x^2)^p/(1 + ff^2*x^2)^(m/2 + p + 1), x], x, T
an[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[m/2] && IntegerQ[p]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \left (a+(a+b) x^2\right ) \, dx,x,\tan (e+f x)\right )}{f} \\ & = \frac {a \tan (e+f x)}{f}+\frac {(a+b) \tan ^3(e+f x)}{3 f} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.09 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.37 \[ \int \sec ^4(e+f x) \left (a+b \sin ^2(e+f x)\right ) \, dx=\frac {b \tan ^3(e+f x)}{3 f}+\frac {a \left (\tan (e+f x)+\frac {1}{3} \tan ^3(e+f x)\right )}{f} \]

[In]

Integrate[Sec[e + f*x]^4*(a + b*Sin[e + f*x]^2),x]

[Out]

(b*Tan[e + f*x]^3)/(3*f) + (a*(Tan[e + f*x] + Tan[e + f*x]^3/3))/f

Maple [A] (verified)

Time = 1.04 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.53

method result size
derivativedivides \(\frac {-a \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (f x +e \right )\right )}{3}\right ) \tan \left (f x +e \right )+\frac {b \left (\sin ^{3}\left (f x +e \right )\right )}{3 \cos \left (f x +e \right )^{3}}}{f}\) \(46\)
default \(\frac {-a \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (f x +e \right )\right )}{3}\right ) \tan \left (f x +e \right )+\frac {b \left (\sin ^{3}\left (f x +e \right )\right )}{3 \cos \left (f x +e \right )^{3}}}{f}\) \(46\)
risch \(-\frac {2 i \left (3 \,{\mathrm e}^{4 i \left (f x +e \right )} b -6 a \,{\mathrm e}^{2 i \left (f x +e \right )}-2 a +b \right )}{3 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3}}\) \(49\)
parallelrisch \(-\frac {2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) \left (\left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right ) a +\frac {2 \left (-a +2 b \right ) \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3}+a \right )}{f \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )^{3} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{3}}\) \(76\)
norman \(\frac {-\frac {2 a \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f}-\frac {2 a \left (\tan ^{9}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}-\frac {8 \left (a +b \right ) \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3 f}-\frac {8 \left (a +b \right ) \left (\tan ^{7}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3 f}-\frac {4 \left (a +4 b \right ) \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3 f}}{\left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )^{3} \left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{2}}\) \(124\)

[In]

int(sec(f*x+e)^4*(a+b*sin(f*x+e)^2),x,method=_RETURNVERBOSE)

[Out]

1/f*(-a*(-2/3-1/3*sec(f*x+e)^2)*tan(f*x+e)+1/3*b*sin(f*x+e)^3/cos(f*x+e)^3)

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.27 \[ \int \sec ^4(e+f x) \left (a+b \sin ^2(e+f x)\right ) \, dx=\frac {{\left ({\left (2 \, a - b\right )} \cos \left (f x + e\right )^{2} + a + b\right )} \sin \left (f x + e\right )}{3 \, f \cos \left (f x + e\right )^{3}} \]

[In]

integrate(sec(f*x+e)^4*(a+b*sin(f*x+e)^2),x, algorithm="fricas")

[Out]

1/3*((2*a - b)*cos(f*x + e)^2 + a + b)*sin(f*x + e)/(f*cos(f*x + e)^3)

Sympy [F]

\[ \int \sec ^4(e+f x) \left (a+b \sin ^2(e+f x)\right ) \, dx=\int \left (a + b \sin ^{2}{\left (e + f x \right )}\right ) \sec ^{4}{\left (e + f x \right )}\, dx \]

[In]

integrate(sec(f*x+e)**4*(a+b*sin(f*x+e)**2),x)

[Out]

Integral((a + b*sin(e + f*x)**2)*sec(e + f*x)**4, x)

Maxima [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 27, normalized size of antiderivative = 0.90 \[ \int \sec ^4(e+f x) \left (a+b \sin ^2(e+f x)\right ) \, dx=\frac {{\left (a + b\right )} \tan \left (f x + e\right )^{3} + 3 \, a \tan \left (f x + e\right )}{3 \, f} \]

[In]

integrate(sec(f*x+e)^4*(a+b*sin(f*x+e)^2),x, algorithm="maxima")

[Out]

1/3*((a + b)*tan(f*x + e)^3 + 3*a*tan(f*x + e))/f

Giac [A] (verification not implemented)

none

Time = 0.33 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.17 \[ \int \sec ^4(e+f x) \left (a+b \sin ^2(e+f x)\right ) \, dx=\frac {a \tan \left (f x + e\right )^{3} + b \tan \left (f x + e\right )^{3} + 3 \, a \tan \left (f x + e\right )}{3 \, f} \]

[In]

integrate(sec(f*x+e)^4*(a+b*sin(f*x+e)^2),x, algorithm="giac")

[Out]

1/3*(a*tan(f*x + e)^3 + b*tan(f*x + e)^3 + 3*a*tan(f*x + e))/f

Mupad [B] (verification not implemented)

Time = 13.21 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.03 \[ \int \sec ^4(e+f x) \left (a+b \sin ^2(e+f x)\right ) \, dx=\frac {{\mathrm {tan}\left (e+f\,x\right )}^3\,\left (\frac {a}{3}+\frac {b}{3}\right )}{f}+\frac {a\,\mathrm {tan}\left (e+f\,x\right )}{f} \]

[In]

int((a + b*sin(e + f*x)^2)/cos(e + f*x)^4,x)

[Out]

(tan(e + f*x)^3*(a/3 + b/3))/f + (a*tan(e + f*x))/f